#ifndef DIALOG_H
#define DIALOG_H

#include <QDialog>

#include "public.h"

namespace Ui {
    class Dialog;
}

class Dialog : public QDialog {
    Q_OBJECT
public:
    Dialog(QWidget *parent = 0);
    ~Dialog();

protected:
    void changeEvent(QEvent *e);

private:
    Ui::Dialog *ui;

private slots:
    void on_pushButton_clicked();
    void on_pushButton_2_clicked();
    void on_msgRecv(int type, char *msg);

signals:
    void writePkg(int type, char *msg, int len);

//////////////////////////////////////////////

private:
    struct user_info_t mUser;
    struct group_info_t mGroup;

    void on_userReceive(int type, char *msg);
    void on_userListReply(int type, char *msg);

public:
    void setUserInfo(int id, QString name);
    void setGroupInfo(int id, QString name);
    void getUserList();

    void closeEvent(QCloseEvent *event);
};

#endif // DIALOG_H
